zoom scrolling: avoid 'jumping back'
authorMatthias Clasen <mclasen@redhat.com>
Mon, 23 Feb 2015 11:42:17 +0000 (06:42 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 23 Feb 2015 11:46:21 +0000 (06:46 -0500)
We record the starting position on button press, but only
start the zoom mode when the long press timeout kicks in.
Depending on circumstances, this can cause a noticable jump.

Avoid this by resetting the recorded starting position after
the long press timeout. Suggested by Sebastian Keller.

gtk/gtkrange.c

index 404dc3a762c54cc302368d85020433fb91fd59cc..bd95ee921747ddb0191d210bc70683eeea394863 100644 (file)
@@ -2437,7 +2437,12 @@ gtk_range_long_press_gesture_pressed (GtkGestureLongPress *gesture,
                                       gdouble              y,
                                       GtkRange            *range)
 {
-  update_zoom_state (range, TRUE);
+  if (!range->priv->zoom)
+    {
+      /* unset initial position so it can be calculated */
+      range->priv->slide_initial_slider_position = -1;
+      update_zoom_state (range, TRUE);
+    }
 }
 
 static void